#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;

class Date {
private:
    int year;
    int month;
    int day;

public:
    Date(int y = 1970, int m = 1, int d = 1) : year(y), month(m), day(d) {}

    ~Date() {}

    Date(const Date& other) : year(other.year), month(other.month), day(other.day) {}

    void display() const {
        cout << year << "-" << month << "-" << day << endl;
    }

    void setDate(int y, int m, int d) {
        year = y;
        month = m;
        day = d;
    }
};

class Person {
private:
    string id;
    string gender;
    Date birthDate;
    string idNumber;

public:
    Person(string id = "", string gender = "", int y = 1970, int m = 1, int d = 1, string idNumber = "")
        : id(id), gender(gender), birthDate(y, m, d), idNumber(idNumber) {}

    ~Person() {
        cout << "Person object with ID " << id << " is being destroyed." << endl;
    }

    Person(const Person& other)
        : id(other.id), gender(other.gender), birthDate(other.birthDate), idNumber(other.idNumber) {}

    void inputInfo() {
        cout << "Enter ID: ";
        cin >> id;
        cout << "Enter gender (Male/Female): ";
        cin >> gender;
        cout << "Enter birth year: ";
        int y, m, d;
        cin >> y;
        cout << "Enter birth month: ";
        cin >> m;
        cout << "Enter birth day: ";
        cin >> d;
        birthDate.setDate(y, m, d);
        cout << "Enter ID number: ";
        cin >> idNumber;
    }

    void displayInfo() const {
        cout << "ID: " << id << endl;
        cout << "Gender: " << gender << endl;
        cout << "Birth Date: ";
        birthDate.display();
        cout << "ID Number: " << idNumber << endl;
    }

    inline string getID() const { return id; }

    inline string getGender() const { return gender; }

    inline string getIDNumber() const { return idNumber; }

    void setInfo(string id = "", string gender = "", int y = 1970, int m = 1, int d = 1, string idNumber = "") {
        if (!id.empty()) this->id = id;
        if (!gender.empty()) this->gender = gender;
        birthDate.setDate(y, m, d);
        if (!idNumber.empty()) this->idNumber = idNumber;
    }
};

int main2() {
    Person person;
    cout << "Enter person information:" << endl;
    person.inputInfo();

    cout << "\nDisplaying person information:" << endl;
    person.displayInfo();

    Person personCopy(person);
    cout << "\nDisplaying copied person information:" << endl;
    personCopy.displayInfo();

    return 0;
}
